check if a file exists rust

245

check if a file exists rust -

use std::path::Path;

fn main() {
    println!("{}", Path::new("/etc/hosts").exists());
}

Comments

Submit
0 Comments